﻿#region Dont Look This
// /*************************************************************************************
// 
// * 文件名称：  MyDisModel.cs
// 
// * 作       者：  jieaido@outlook.com
// 
// * 创建日期：  2020/04/05/15:06
// 
// * 修改日期:     2020/04/05/15:06
// 
// * 功能描述：
// 
// 
// 
//                               Copyright (c) Jieaido. AllRights Reserved
// 
// *************************************************************************************/
#endregion

using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;

namespace HelpLibrary.SQlite
{
    public class MyDisModel
    {
        public MyDisModel(Gr gr)
        {
            CreateTime = gr.CreateTime;
            a = gr.a;
            b = gr.b;
            c = gr.c;
            d = gr.d;
            e = gr.e;
            f = gr.f;
            YeBanGr = gr.YeBanGr;
            BaiBanGr = gr.BaiBanGr;
            ZhongBanGr = gr.ZhongBanGr;
            YeBan = gr.YeBan;
            Baiban = gr.Baiban;
            Zhongban = gr.Zhongban;


        }

        public MyDisModel ZeroModel()
        {
            YeBanGr = 0;
            BaiBanGr =0;
            ZhongBanGr = 0;
            return this;
        }
        [DisplayName("时间")]
        public DateTime CreateTime { get; set; }
        [DisplayName("0点")]
        public float a { get; set; }
        [DisplayName("8点")]
        public float b { get; set; }
        [DisplayName("12点")]
        public float c { get; set; }
        [DisplayName("16点")]
        public float d { get; set; }
        [DisplayName("18点")]
        public float e { get; set; }
        [DisplayName("22点")]
        public float f { get; set; }
       

        [NotMapped]
        [DisplayName("夜班")]
        public float YeBanGr { get; set; }
        


        [NotMapped]
        [DisplayName("班次1")]
        public WorkShift YeBan { get; set; }
        [NotMapped]
        [DisplayName("白班")]
        public float BaiBanGr { get; set; }

        [NotMapped]
        [DisplayName("班次2")]
        public WorkShift Baiban { get; set; }
        [DisplayName("中班")]
        [NotMapped]
        public float ZhongBanGr { get; set; }

        [NotMapped]
        [DisplayName("班次3")]
        public WorkShift Zhongban { get; set; }
    }
    /// <summary>
    /// 班次查询时的显示模型
    /// </summary>
    public class MyDisBanciModel
    {
        public MyDisBanciModel(MyDisModel gr,string banci,float guirong)
        {
            CreateTime = gr.CreateTime;
            a = gr.a;
            b = gr.b;
            c = gr.c;
            d = gr.d;
            e = gr.e;
            f = gr.f;
            this.Banci = banci;
            this.guirong = guirong;


        }

      
        [DisplayName("时间")]
        public DateTime CreateTime { get; set; }
        [DisplayName("0点")]
        public float a { get; set; }
        [DisplayName("8点")]
        public float b { get; set; }
        [DisplayName("12点")]
        public float c { get; set; }
        [DisplayName("16点")]
        public float d { get; set; }
        [DisplayName("18点")]
        public float e { get; set; }
        [DisplayName("22点")]
        public float f { get; set; }
        [DisplayName("柜容")]
        public float guirong { get; set; }
        [DisplayName("班次")]
        public string Banci { get; set; }


    }

    public class MyStatisticsModel
    {
        public MyStatisticsModel(string name)
        {
            this.name = name;
        }
        [DisplayName("班次")]
        public string name { get; set; }
        [DisplayName("夜班次数")]
        public int yeBanCount { get; set; }
        [DisplayName("白班次数")]
        public int baiBanCount { get; set; }
        [DisplayName("中班次数")]
        public int zhongBanCount { get; set; }
        [DisplayName("夜班累积")]
        public float YeBanSum{ get; set; }
        [DisplayName("白班累积")]
        public float BaiBanSum{ get; set; }
        [DisplayName("中班累积")]
        public float ZhongBanSum{ get; set; }
        [DisplayName("柜容差累积")]
        public float GrSum
        {
            get
            {
                return YeBanSum / yeBanCount + BaiBanSum / baiBanCount + ZhongBanSum / zhongBanCount;
            }
        }

    }
}